from selenium import webdriver  # 导入自动化模块
import time # 导入时间模块


# 创建类
class MyText():
    def __init__(self):
        # 声明浏览器实例
        self.browser = webdriver.Chrome('C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe')

    def get_url(self,url):
        # 打开浏览器
        self.browser.get(url)

        # # 睡眠两秒
        # time.sleep(2)

        # # 关闭浏览器
        # self.browser.quit()


mytext = MyText()
mytext.get_url('http://localhost:8080/#/news/')